<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AlertTypeToOpenShopUserContractTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('open_shop_user_contract', function (Blueprint $table) {
            $table->tinyInteger('mode')->default(1)->comment('加盟模式 1-传统模式 2分账模式')->after('contractStatus');
            $table->json("content")->nullable()->default('')->comment("分账模式信息")->after('mode');
            $table->string('inviterId',20)->default('')->comment('邀请人id-feishuUserId')->after('content');
            $table->string('inviterName',50)->default('')->comment('邀请人名称')->after('inviterId');
            $table->string('departmentName',120)->default('')->comment('部门名称')->after('inviterName');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('open_shop_user_contract', function (Blueprint $table) {
            $table->dropColumn('mode');
            $table->dropColumn('content');
            $table->dropColumn('inviterId');
            $table->dropColumn('inviterName');
            $table->dropColumn('departmentName');
        });
    }
}
